package staticindex;
public class Student {
    //描述 一 类 事物的类
    //javaBean 不需要写main方法
    //私有化成员变量
    //构造方法 空参 带全部参数
    //自定义的方法
    //get()/set()
    //属性
    private String name;
    private  int age;
    private  String gender;
    private  int id;
    //老师的姓名
    public static String teacherName;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    //构造方法

    public Student() {
    }

    public Student(String name, int age, String gender, int id) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.id = id;
    }
    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", id=" + id +
                '}';
    }
    //自定义的方法
    public void showAll(){
        System.out.println("{"+name+","+age+","+gender+","+id+","+teacherName+"}");
    }
}
